home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / c-tools / c_examples / rastport / rastport_example.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-16  |  1.3 KB  |  52 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. // Button Example
  3. // 5.18.96 Deryk Robosson
  4.  
  5. //////////////////////////////////////////////////////////////////////////////
  6. // Includes
  7. #include "aframe:include/amigaapp.hpp"
  8. #include "aframe:include/window.hpp"
  9. #include "aframe:include/rect.hpp"
  10. #include "aframe:include/reqtools.hpp"
  11. #include "aframe:include/rastport.hpp"
  12.  
  13. //////////////////////////////////////////////////////////////////////////////
  14. // MAIN
  15.  
  16. void main()
  17. {
  18.     AFAmigaApp theApp;
  19.     AFWindow win;
  20.     AFRastPort rp(&win);
  21.     AFReqTools rt;
  22.     AFRect rect(10,10,410,310);
  23.  
  24.     win.Create(&theApp,&rect,"AFrame RastPort Example");
  25.     rp.FromWindow(&win);
  26.  
  27.     rt.EZRequest("Drawing a Box","Ok");
  28.     rect.SetRect(10,10,30,30);
  29.     rp.SetAPen(2);
  30.     rp.Rect(&rect);
  31.  
  32.     rt.EZRequest("Drawing a filled Box","Ok");
  33.     rect.SetRect(32,10,52,30);
  34.     rp.SetAPen(3);
  35.     rp.RectFill(&rect);
  36.  
  37.     rt.EZRequest("Drawing Text","Ok");
  38.     rp.SetAPen(4);
  39.     rp.TextOut(10,40,(char*)"AFrame is God like",18);
  40.  
  41.     rt.EZRequest("Drawing an Ellipse","Ok");
  42.     rect.SetRect(100,100,150,150);
  43.     rp.SetAPen(5);
  44.     rp.DrawEllipse(&rect);
  45.  
  46.     rt.EZRequest("Clearing with another pen","Ok");
  47.     rp.SetAPen(6);
  48.     rp.Clear();
  49.  
  50.     theApp.RunApp();
  51. }
  52.